<%@page import="java.util.ArrayList"%>
<%@page import="my.db.DTO.ArticleTypeDTO"%>
<%@ include file="sites/ad_header.jsp" %>
<%
	if(session.getAttribute("user") ==null){
		response.sendRedirect("LoadIndex.jsp");
	}
%>
		<div class="r-body">
				<div class="page-title">
					<p>Add New Article</p>
				</div>
				<div class="frm-action">
					<form action="./add_new_Article.article" method="POST" enctype="multipart/form-data" >
					<table border="0" cellpadding="10">
					<!-- articleNo, articleTitle, articleDate,
						articleContent, userID, articleTypeID,
					 -->
						<tr>
							<td width="150">Article Title</td>
							<td>: <input type="text" name="articleTitle" class="articleTitle" required="required"/></td>
							
						</tr>
						<tr>
							<td>Article Type</td>
							<td>:
								<select name="articleTypeID" class="articleTypeID">
								<%
									ArrayList<ArticleTypeDTO> ar=(ArrayList<ArticleTypeDTO>)request.getAttribute("ArticleTypeNew");
									if(ar!=null){
									for(int i=0;i<ar.size();i++){
								%>
									<option value=<%=ar.get(i).getTypeID()%>><%=ar.get(i).getTypeName()%></option>
								<%}} %>
								</select>
							</td>
						</tr>
						
						<tr>
							<td>Upload Book Cover</td>
							<td>:<input type="file" name="articleImage" class="articleImage"> </td>
						</tr>
						
						<tr>
							<td colspan="2">
							<textarea rows="20" cols="80" name="articleContent" class="articleContent" id="articleContent"></textarea>
							</td>
						</tr>
						<tr>
							<td></td>
							<td><input type="submit" value="SAVE" class="btn-default" style="float:right;"/></td>
						</tr>
						
					</table>
					</form>
				</div>
			</div><!-- end body -->
	</div><!-- end r-main -->
	<script type="text/javascript">
		CKEDITOR.replace("articleContent");
		$(function(){
			/*
			 $(".articleDate").datepicker({
					changeMonth: true,
					changeYear: true
			 });
			*/
			//alert("HI");
		});
	</script>
</body>
</html>